home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_bas / t2win_32.zip / _DATYPE.FRM < prev    next >
Text File  |  1996-05-14  |  11KB  |  340 lines

  1. VERSION 4.00
  2. Begin VB.Form frmDAType 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Disk array : type"
  5.    ClientHeight    =   4065
  6.    ClientLeft      =   1890
  7.    ClientTop       =   3255
  8.    ClientWidth     =   9285
  9.    Height          =   4470
  10.    Left            =   1830
  11.    MaxButton       =   0   'False
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   4065
  14.    ScaleWidth      =   9285
  15.    ShowInTaskbar   =   0   'False
  16.    Top             =   2910
  17.    Width           =   9405
  18.    Begin Threed.SSPanel SSPanel1 
  19.       Align           =   1  'Align Top
  20.       Height          =   480
  21.       Left            =   0
  22.       TabIndex        =   2
  23.       Top             =   0
  24.       Width           =   9285
  25.       _Version        =   65536
  26.       _ExtentX        =   16378
  27.       _ExtentY        =   847
  28.       _StockProps     =   15
  29.       ForeColor       =   -2147483640
  30.       BackColor       =   12632256
  31.       Begin VB.ComboBox cmb_Function 
  32.          Height          =   315
  33.          Left            =   1365
  34.          TabIndex        =   3
  35.          Top             =   90
  36.          Width           =   6570
  37.       End
  38.       Begin Threed.SSCommand cmdNP 
  39.          Height          =   300
  40.          Index           =   1
  41.          Left            =   8925
  42.          TabIndex        =   7
  43.          Top             =   90
  44.          Width           =   255
  45.          _Version        =   65536
  46.          _ExtentX        =   450
  47.          _ExtentY        =   529
  48.          _StockProps     =   78
  49.          Caption         =   ">"
  50.          BevelWidth      =   1
  51.          Font3D          =   3
  52.          RoundedCorners  =   0   'False
  53.          Outline         =   0   'False
  54.       End
  55.       Begin Threed.SSCommand cmdNP 
  56.          Height          =   300
  57.          Index           =   0
  58.          Left            =   8085
  59.          TabIndex        =   6
  60.          Top             =   90
  61.          Width           =   255
  62.          _Version        =   65536
  63.          _ExtentX        =   450
  64.          _ExtentY        =   529
  65.          _StockProps     =   78
  66.          Caption         =   "<"
  67.          BevelWidth      =   1
  68.          Font3D          =   3
  69.          RoundedCorners  =   0   'False
  70.          Outline         =   0   'False
  71.       End
  72.       Begin VB.Label Label2 
  73.          Caption         =   "&Select a function"
  74.          Height          =   255
  75.          Left            =   90
  76.          TabIndex        =   5
  77.          Top             =   120
  78.          Width           =   1275
  79.       End
  80.       Begin Threed.SSCommand SSCommand1 
  81.          Default         =   -1  'True
  82.          Height          =   300
  83.          Left            =   8400
  84.          TabIndex        =   4
  85.          Top             =   90
  86.          Width           =   465
  87.          _Version        =   65536
  88.          _ExtentX        =   820
  89.          _ExtentY        =   529
  90.          _StockProps     =   78
  91.          Caption         =   "&Go"
  92.          BevelWidth      =   1
  93.          RoundedCorners  =   0   'False
  94.          Outline         =   0   'False
  95.       End
  96.    End
  97.    Begin VB.Label lbl_Result 
  98.       Appearance      =   0  'Flat
  99.       BackColor       =   &H80000005&
  100.       BackStyle       =   0  'Transparent
  101.       ForeColor       =   &H80000008&
  102.       Height          =   3345
  103.       Left            =   2940
  104.       TabIndex        =   1
  105.       Top             =   630
  106.       Width           =   6315
  107.    End
  108.    Begin VB.Label lbl_Open 
  109.       Appearance      =   0  'Flat
  110.       BackColor       =   &H80000005&
  111.       BackStyle       =   0  'Transparent
  112.       BeginProperty Font 
  113.          name            =   "Courier New"
  114.          charset         =   0
  115.          weight          =   400
  116.          size            =   8.25
  117.          underline       =   0   'False
  118.          italic          =   0   'False
  119.          strikethrough   =   0   'False
  120.       EndProperty
  121.       ForeColor       =   &H80000008&
  122.       Height          =   3345
  123.       Left            =   90
  124.       TabIndex        =   0
  125.       Top             =   630
  126.       Width           =   2715
  127.    End
  128. End
  129. Attribute VB_Name = "frmDAType"
  130. Attribute VB_Creatable = False
  131. Attribute VB_Exposed = False
  132. Option Explicit
  133. Option Base 1
  134.  
  135. Private Const Iteration = 50
  136.  
  137. Dim IsLoaded         As Integer
  138.  
  139. Dim TimerStartOk     As Integer
  140. Dim TimerCloseOk     As Integer
  141.  
  142. Dim TimerHandle      As Integer
  143. Dim TimerValue       As Long
  144.  
  145.       
  146.  
  147. Private Sub cmdNP_Click(Index As Integer)
  148.  
  149.    Call sub_NextPrev(cmb_Function, Index)
  150.  
  151. End Sub
  152.  
  153.  
  154. Private Sub cmb_Function_Click()
  155.    
  156.    If (IsLoaded = False) Then Exit Sub
  157.    
  158.    Call cDisableFI(mdiT2W.Picture1)
  159.    
  160.    lbl_Result = ""
  161.    
  162.    DoEvents
  163.    
  164.    Call TestDAType(cmb_Function.ListIndex - 1)
  165.  
  166.    DoEvents
  167.    Call cEnableFI(mdiT2W.Picture1)
  168.    
  169. End Sub
  170.  
  171.  
  172. Private Sub Form_Activate()
  173.  
  174.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  175.  
  176. End Sub
  177.  
  178. Private Sub Form_Load()
  179.  
  180.    IsLoaded = False
  181.    
  182.    Show
  183.  
  184.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_datype.t2w")
  185.    
  186.    IsLoaded = True
  187.    
  188. End Sub
  189.  
  190. Private Sub Form_Unload(Cancel As Integer)
  191.  
  192.    Dim intResult        As Integer
  193.  
  194.    intResult = cKillFileAll("c:\t2w_tmp\datype.tmp")
  195.  
  196. End Sub
  197.  
  198.  
  199. Private Sub SSCommand1_Click()
  200.    
  201.    Call cmb_Function_Click
  202.    
  203. End Sub
  204.  
  205.  
  206.  
  207.  
  208. Private Sub TestDAType(intManagement As Integer)
  209.    
  210.    Dim intResult        As Integer
  211.    Dim strResult        As String
  212.    Dim strOpen          As String
  213.    Dim strDisplay       As String
  214.    
  215.    Dim i                As Integer
  216.    Dim DA               As tagDISKARRAY
  217.    Dim PEY              As tagPROCESSENTRY
  218.    
  219.    intResult = 0
  220.    
  221.    strResult = ""
  222.    strOpen = ""
  223.    strDisplay = ""
  224.       
  225.    DA.nFilename = T2WDirTest + "\datype.tmp"
  226.    DA.nType = Len(PEY)
  227.    DA.nIsTyped = True
  228.    DA.nRows = 10
  229.    DA.nCols = 10
  230.    DA.nSheets = 2
  231.  
  232.    Select Case intManagement
  233.       Case True      'create
  234.          intResult = cDACreate(DA, True)
  235.       Case False     'use
  236.          intResult = cDACreate(DA, False)
  237.       Case 1         'clear all
  238.          intResult = cDACreate(DA, False)
  239.          If (intResult = -1) Then intResult = cDAClear(DA)
  240.       Case 2         'clear sheet 2
  241.          intResult = cDACreate(DA, False)
  242.          If (intResult = -1) Then intResult = cDAClearSheet(DA, 2)
  243.       Case 3         'clear last row
  244.          intResult = cDACreate(DA, False)
  245.          If (intResult = -1) Then intResult = cDAClearRow(DA, DA.nRows, 1)
  246.       Case 4         'clear last col
  247.          intResult = cDACreate(DA, False)
  248.          If (intResult = -1) Then intResult = cDAClearCol(DA, DA.nCols, 1)
  249.       Case 5         'clear last row in all sheets
  250.          intResult = cDACreate(DA, False)
  251.          If (intResult = -1) Then intResult = cDAClearRow(DA, DA.nRows, -1)
  252.       Case 6         'clear last col in all sheets
  253.          intResult = cDACreate(DA, False)
  254.          If (intResult = -1) Then intResult = cDAClearCol(DA, DA.nCols, -1)
  255.    End Select
  256.  
  257.    strDisplay = strDisplay & "Last intResult = " & intResult & vbCrLf & vbCrLf
  258.  
  259.    If (intResult = True) Then
  260.       
  261.       strOpen = strOpen & "daSize       = " & DA.daSize & vbCrLf
  262.       strOpen = strOpen & "Signature    = " & DA.signature & vbCrLf
  263.       strOpen = strOpen & "nFilename    = " & Trim$(cGetInPartR(DA.nFilename, "\", True)) & vbCrLf
  264.       strOpen = strOpen & "nType        = " & DA.nType & vbCrLf
  265.       strOpen = strOpen & "nIsTyped     = " & DA.nIsTyped & vbCrLf
  266.       strOpen = strOpen & "nRows        = " & DA.nRows & vbCrLf
  267.       strOpen = strOpen & "nCols        = " & DA.nCols & vbCrLf
  268.       strOpen = strOpen & "nSheets      = " & DA.nSheets & vbCrLf
  269.       strOpen = strOpen & "rHandle      = " & DA.rHandle & vbCrLf
  270.       strOpen = strOpen & "rElementSize = " & DA.rElementSize & vbCrLf
  271.       strOpen = strOpen & "rFileSize    = " & DA.rFileSize & vbCrLf
  272.       strOpen = strOpen & "rParts       = " & DA.rParts & vbCrLf
  273.       strOpen = strOpen & "rRemain      = " & DA.rRemain & vbCrLf
  274.       strOpen = strOpen & "rSheetSize   = " & DA.rSheetSize & vbCrLf
  275.       strOpen = strOpen & "rTime        = " & DA.rTime & vbCrLf & vbCrLf
  276.  
  277.       If (intManagement = True) Then
  278.       
  279.          intResult = cProcess(PEY, True)
  280.          Call cDAPutType(DA, 1, 1, 1, PEY)
  281.          intResult = cProcess(PEY, False)
  282.          Call cDAPutType(DA, 1, DA.nCols, 1, PEY)
  283.          intResult = cProcess(PEY, False)
  284.          Call cDAPutType(DA, DA.nRows, 1, 1, PEY)
  285.          intResult = cProcess(PEY, False)
  286.          Call cDAPutType(DA, DA.nRows, DA.nCols, 1, PEY)
  287.    
  288.          intResult = cProcess(PEY, False)
  289.          Call cDAPutType(DA, 1, 1, 2, PEY)
  290.          intResult = cProcess(PEY, False)
  291.          Call cDAPutType(DA, 1, DA.nCols, 2, PEY)
  292.          intResult = cProcess(PEY, False)
  293.          Call cDAPutType(DA, DA.nRows, 1, 2, PEY)
  294.          intResult = cProcess(PEY, False)
  295.          Call cDAPutType(DA, DA.nRows, DA.nCols, 2, PEY)
  296.  
  297.       End If
  298.    
  299.       Call cDAGetType(DA, 1, 1, 1, PEY)
  300.       strDisplay = strDisplay & "R:1  , C:1  , D:1, PEY.szExeFile : " & cCompress(PEY.szExeFile) & "   , time : " & DA.rTime & Chr$(13)
  301.       Call cDAGetType(DA, 1, DA.nCols, 1, PEY)
  302.       strDisplay = strDisplay & "R:1  , C:" & DA.nCols & ", D:1, PEY.szExeFile : " & cCompress(PEY.szExeFile) & "   , time : " & DA.rTime & Chr$(13)
  303.       Call cDAGetType(DA, DA.nRows, 1, 1, PEY)
  304.       strDisplay = strDisplay & "R:" & DA.nRows & ", C:1  , D:1, PEY.szExeFile : " & cCompress(PEY.szExeFile) & "   , time : " & DA.rTime & Chr$(13)
  305.       Call cDAGetType(DA, DA.nRows, DA.nCols, 1, PEY)
  306.       strDisplay = strDisplay & "R:" & DA.nRows & ", C:" & DA.nCols & ", D:1, PEY.szExeFile : " & cCompress(PEY.szExeFile) & "   , time : " & DA.rTime & Chr$(13)
  307.    
  308.       Call cDAGetType(DA, 1, 1, 2, PEY)
  309.       strDisplay = strDisplay & "R:1  , C:1  , D:2, PEY.szExeFile : " & cCompress(PEY.szExeFile) & "   , time : " & DA.rTime & Chr$(13)
  310.       Call cDAGetType(DA, 1, DA.nCols, 2, PEY)
  311.       strDisplay = strDisplay & "R:1  , C:" & DA.nCols & ", D:2, PEY.szExeFile : " & cCompress(PEY.szExeFile) & "   , time : " & DA.rTime & Chr$(13)
  312.       Call cDAGetType(DA, DA.nRows, 1, 2, PEY)
  313.       strDisplay = strDisplay & "R:" & DA.nRows & ", C:1  , D:2, PEY.szExeFile : " & cCompress(PEY.szExeFile) & "   , time : " & DA.rTime & Chr$(13)
  314.       Call cDAGetType(DA, DA.nRows, DA.nCols, 2, PEY)
  315.       strDisplay = strDisplay & "R:" & DA.nRows & ", C:" & DA.nCols & ", D:2, PEY.szExeFile : " & cCompress(PEY.szExeFile) & "   , time : " & DA.rTime & Chr$(13)
  316.  
  317.    End If
  318.  
  319.    Call cDAClose(DA, False)
  320.  
  321.    lbl_Open = strOpen
  322.    lbl_Result = strDisplay
  323.  
  324.    'time the function
  325.  
  326.    TimerHandle = cTimerOpen()
  327.    TimerStartOk = cTimerStart(TimerHandle)
  328.    
  329.    For i = 1 To Iteration
  330.       strResult = cDACreate(DA, False)
  331.       Call cDAClose(DA, False)
  332.    Next i
  333.    
  334.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  335.    
  336.    TimerCloseOk = cTimerClose(TimerHandle)
  337.  
  338. End Sub
  339.  
  340.